Don't call into the backend if the region is empty. (#437081, Sven
authorMatthias Clasen <mclasen@redhat.com>
Thu, 10 May 2007 19:23:30 +0000 (19:23 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Thu, 10 May 2007 19:23:30 +0000 (19:23 +0000)
2007-05-10  Matthias Clasen <mclasen@redhat.com>

        * gdk/gdkdraw.c (gdk_draw_pixbuf): Don't call into
        the backend if the region is empty.  (#437081, Sven Neumann)

svn path=/trunk/; revision=17813

ChangeLog
gdk/gdkdraw.c

index 61c221f08336b589ed9b65339fcb1c5d14a45c82..540397bbc86a2b1bf056aa8c0013f291c97503bc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-05-10  Matthias Clasen <mclasen@redhat.com>
+
+       * gdk/gdkdraw.c (gdk_draw_pixbuf): Don't call into
+       the backend if the region is empty.  (#437081, Sven Neumann)
+
 2007-05-10  Matthias Clasen <mclasen@redhat.com>
 
        * gtk/gtksearchenginesimple.c (search_visit_func);
index 6905d510b8347144028218d9e92b0356e147010e..5b72dd75ad55240b447cdef3a0e89a035ad9a0f6 100644 (file)
@@ -751,13 +751,17 @@ gdk_draw_pixbuf (GdkDrawable     *drawable,
   g_return_if_fail (gc == NULL || GDK_IS_GC (gc));
   g_return_if_fail (GDK_IS_PIXBUF (pixbuf));
 
+  if (width == 0 || height == 0)
+    return;
+
   if (width == -1)
     width = gdk_pixbuf_get_width (pixbuf);
   if (height == -1)
     height = gdk_pixbuf_get_height (pixbuf);
 
   GDK_DRAWABLE_GET_CLASS (drawable)->draw_pixbuf (drawable, gc, pixbuf,
-                                                 src_x, src_y, dest_x, dest_y, width, height,
+                                                 src_x, src_y, dest_x, dest_y,
+                                                  width, height,
                                                  dither, x_dither, y_dither);
 }